package com.gu.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.gu.entity.PropertyDO;
import java.util.List;
import com.gu.mapper.PropertyMapper;

/**
* The Table gu_property.
* 物业表
*/
@Repository
public class PropertyDAO{

    @Autowired
    private PropertyMapper propertyMapper;

    /**
     * desc:插入表:gu_property.<br/>
     * @param entity entity
     * @return Integer
     */
    public Integer insert(PropertyDO entity){
        return propertyMapper.insert(entity);
    }
    /**
     * desc:批量插入表:gu_property.<br/>
     * @param list list
     * @return Integer
     */
    public Integer insertBatch(List<PropertyDO> list){
        return propertyMapper.insertBatch(list);
    }
    /**
     * desc:根据主键删除数据:gu_property.<br/>
     * @param id id
     * @return Integer
     */
    public Integer deleteById(Integer id){
        return propertyMapper.deleteById(id);
    }
    /**
     * desc:根据主键获取数据:gu_property.<br/>
     * @param id id
     * @return PropertyDO
     */
    public PropertyDO getById(Integer id){
        return propertyMapper.getById(id);
    }

    public List<PropertyDO> propertyList(String selectUserParam,Integer id,Integer repairStatus){
        return propertyMapper.propertyList(selectUserParam,id,repairStatus);
    }

    public List<PropertyDO> propertyListNew(Integer repairStatus){
        return propertyMapper.propertyListNew(repairStatus);
    }

    public List<PropertyDO> propertyListByUserId(Integer ownerId, Integer repairStatus){
        return propertyMapper.propertyListByUserId(ownerId, repairStatus);
    }

    public int updateRepairStatus(PropertyDO propertyDO){
        return propertyMapper.updateRepairStatus(propertyDO);
    }

    /**
     * 批量删除
     * @param ids
     * @return
     */
    public Integer deleteByIds(@Param("ids") Integer[] ids){
        return propertyMapper.deleteByIds(ids);
    }
}
